<template>
	<button v-clickReTime @click="add">点击{{num}}</button>
	<div v-clickReTime @click="add2">点击{{num2}}</div>
	<div>插件使用{{ $firstText(name) }}</div>
	<div>插件使用{{ $firstText(name2) }}</div>
	<div>store:{{ store }}</div>
	<div>store:{{ store.name }}</div>
	
	<button @click="onModalOpen">Open Modal</button>
	<button @click="changeT">修改title</button>
	<button @click="changeSun">修改孙组件内容</button>
	<div>爷爷收到红包{{redNum}}</div>
	<div v-upperText="'def'"></div>
	<child @submit="submitfun" @close="closefun" :name="title" :isshow="isshow">
		<div>内容</div>
	</child>
	
</template>

<script setup>
	import { store } from './user.js'
	import child from './child.vue'
	import {ref,provide }from "vue"
	const count = ref(99)
	const redNum = ref(0)
	const name = ref('xiaoming')
	const name2 = ref('zhangsan')
	const num = ref(0)
	const num2 = ref(0)
	const redbox = function(){
		redNum.value = 20
	}
	provide('message',count)
	provide('redbox',redbox)
	const changeSun = function(d){
		count.value = 101
	}
	
	let isshow = ref(false)
	let title = ref('三娃子')
	let onModalOpen=()=>{
		isshow.value = true
	}
	const submitfun = function(d){
		isshow.value = false
		console.log(d);
	}
	const closefun = function(d){
		isshow.value = false
		console.log(d);
	}
	const add = function(){
		num.value++;
	}
	const add2 = function(){
		num2.value++;
	}
</script>
